import Home from "../views/home/Home.vue"  
import Center from "../views/center/Center.vue"
import UserAdd from "../views/user-manage/UserAdd.vue" //用户增加
import UserList from "../views/user-manage/UserList.vue" //用户列表
import NewsAdd from "../views/news-manage/NewsAdd.vue" //新闻增加
import NewsList from "../views/news-manage/NewsList.vue" //新闻列表
import NewsEdit from "../views/news-manage/NewsEdit.vue" //新闻编辑
import WorkAdd from "../views/work-manage/WorkAdd.vue" //工作增加
import WorkList from "../views/work-manage/WorkList.vue" //工作列表
import WorkEdit from "../views/work-manage/WorkEdit.vue" //工作编辑
import AddProprietorMsg from "../views/proprietor-manage/AddProprietorMsg.vue"//业主信息添加
import ProprietorMsg from "../views/proprietor-manage/ProprietorMsg.vue"//业主信息管理
import AddAccount from "../views/proprietor-manage/AddAccount.vue" //业主账号添加
import AccountList from "../views/proprietor-manage/AccountList.vue" //业主账号添加

import AddExpense from "../views/propertycharges-manage/AddExpense.vue"//物业费用add
import Expense from "../views/propertycharges-manage/Expense.vue"//物业费用管理
import Notification from "../views/propertycharges-manage/Notification.vue"//缴费通知管理
import Search from "../views/propertycharges-manage/Search.vue"//缴费记录管理
import Sheet from "../views/propertycharges-manage/Sheet.vue"//报表统计管理
import Notfound from "../views/notfound/NotFound.vue"//404页面

//创建子路由数组
const routes = [{
    //动态添加路由 
        path:"/index", //首页 http://localhost:8080/#/index 不需要/mainbox/index
        component:Home
    },
    {
        path:"/center", //个人中心
        component:Center
    },
    {
        path:"/user-manage/useradd", //用户增加
        component:UserAdd,
        requireAdmin:true
    },
    {
        path:"/user-manage/userlist", //用户列表
        component:UserList,
        requireAdmin:true
    },
    {
        path:"/news-manage/newsadd", //新闻增加
        component:NewsAdd
    },
    {
        path:"/news-manage/newslist", //新闻列表
        component:NewsList 
    },
    {
        path:"/news-manage/editnews/:id", //新闻编辑
        component:NewsEdit
    },
    {
        path:"/work-manage/workadd", //工作增加
        component:WorkAdd
    },
    {
        path:"/work-manage/worklist", //工作列表/work-manage/editnews/
        component:WorkList
    },
    {
        path:"/work-manage/editwork/:id", //工作编辑
        component:WorkEdit
    },
    {
        path:"/proprietor-manage/addproprietormsg", //添加业主信息
        component:AddProprietorMsg
    },
    {
        path:"/proprietor-manage/proprietormsg", //业主信息
        component:ProprietorMsg
    },
    {
        path:"/proprietor-manage/addaccount", //添加业主账号
        component:AddAccount
    },
    {
        path:"/proprietor-manage/accountlist", //业主账号管理
        component:AccountList
    },
    {
        path:"/propertycharges-manage/addexpense", //物业费用add
        component:AddExpense
    },
    {
        path:"/propertycharges-manage/expense", //物业费用管理
        component:Expense
    },
    {
        path:"/propertycharges-manage/notification", //缴费通知管理
        component:Notification
    },
    {
        path:"/propertycharges-manage/search", //缴费记录管理
        component:Search
    },
    {
        path:"/propertycharges-manage/sheet", //报表统计管理
        component:Sheet
    },
    {
        path:"/",
        redirect:"/login"  
    },
    {
        path:"/:pathMatch(.*)*",
        name:"Notfound",
        component:Notfound
    }

]

export default routes